package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/13
 */
public class TestAccount {
    public static void main(String[] args) {
        // 创建活期账户对象并设置属性
        CurrentAccount currentAccount = new CurrentAccount();
        currentAccount.setAccountNumber(123456);
        currentAccount.setBalance(10000);

        // 调用模板方法，计算并显示活期账户利息
        currentAccount.calculateAndDisplayInterest();

        // 创建定期账户对象并设置属性
        SavingAccount savingAccount = new SavingAccount();
        savingAccount.setAccountNumber(654321);
        savingAccount.setBalance(20000);

        // 调用模板方法，计算并显示定期账户利息
        savingAccount.calculateAndDisplayInterest();
    }
}
